<style lang="less" scoped>
@primary-color:#FE9333;//橘黄色默认颜色
@font-color:#686E71;//正常字体颜色
@font-blue-color:#4CB2EB;//蓝色字体
	.header {
		position: fixed;
		top:0;
		left:0;
		height:60px;
		width:100%;
		min-width:1100px;
		background:#2A2A2A;
		z-index:11;
		.logo-div{
			float: left;
			padding-left:30px;	
			height: 60px;
			display: flex;
			align-items: center;			
			.logo{
				background:url('../images/logo.png') 0 center no-repeat;
				width:93px;
				height:32px;
				display: inline-block;
			}
		}		
		.navbox{
			display:inline-block;
			font-size: 16px;
			color: #686E71;
			line-height:60px;			
			a{
				float:left;
				margin-left:60px;
			}
			.router-link-active{
				color:#FE9333;
				border-bottom: 2px solid #FE9333;
				height: 54px;
			}
		}
		.headerPhone{
			float: right;
			height: 60px;
			display: flex;
			align-items: center;
			margin-right: 85px;
			img{
				width: 188px;
				height: 24px;
			}
		}
		.loginbox{
			float:right;
			margin-right:20px;
			font-size: 14px;
			line-height: 60px;
			a{
				padding:5px 15px;
			}
			.reg{
				margin-left:30px;
				color:@primary-color;
				border:1px solid @primary-color;
				border-radius:20px;
			}
		}
		.loginbox-after{
			float:right;			
			cursor: pointer;
			.div{
				width: 40px;
				height: 40px;
				margin-top:10px;
				border-radius: 50%;
				float: left;
				display: flex;
				justify-content: center;
				align-items: center;
				overflow: hidden;
				img{
					width: 100%;
					height: 100%;
				}
			}
			.p{
				float: left;
				color:@font-color;
				font-size: 16px;
				margin-left: 20px;
				line-height: 60px;
			}
			.span:hover{
				color: @primary-color;
			}
			.span{
				color:@font-color;
				font-size: 16px;
				margin-left: 30px;
				line-height: 60px;
				cursor: pointer;
			}
			.userCenterRight{
				position: fixed;
				top:60px;
				right: -240px;
				width: 240px;
				height: 100px;
				background: #2B2B2B;
				transition: all 0.5s;
				.img{
					width: 100px;
					height: 100px;
					border-radius: 50%;
					margin: 100px 0 14px 70px;
					line-height: 0;
				}
				.name{
					width: 100%;
					text-align:center;
					font-size: 16px;
					color: #FFFFFF;
					line-height: 22px;
					margin-bottom: 44px;
				}
				.ul{
					text-align: center;
					font-size: 16px;
					color: #B4BDC1;
					border-top: 1px solid #000;
					li{
						width: 100%;
						height: 50px;
						line-height: 50px;
						border-bottom: 1px solid #000;
						cursor: pointer;
						font-size: 16px;
						color: #B5BDC2;
						span{
							width: 20px;
							height: 20px;
							display: inline-block;
							vertical-align: middle;
							margin:0 27px 0 0;
						}
					}
					li:hover{
						color: #FE9333;
						border-bottom: 1px solid #FE9333;
					}
					.span1{
							background: url("../images/usercenter_leftnav_grzl.png") no-repeat;
							background-size: 100% 100%;
					}
					.span2{
							background: url("../images/usercenter_leftnav_aqsz.png") no-repeat;
							background-size: 100% 100%;
					}
					.span3{
							background: url("../images/usercenter_leftnav_zjxx.png") no-repeat;
							background-size: 100% 100%;
					}
					.span4{
							background: url("../images/usercenter_leftnav_xxzx.png") no-repeat;
							background-size: 100% 100%;
					}   
					.li1:hover{
						border-bottom: 1px solid #FE9333;
						color: #FE9333;
						.span1{
							background: url("../images/usercenter_leftnav_grzl_hover.png") no-repeat;
							background-size: 100% 100%;
						}
					}
					.li2:hover{
						border-bottom: 1px solid #FE9333;
						color: #FE9333;
						.span2{
							background: url("../images/usercenter_leftnav_aqsz_hover.png") no-repeat;
							background-size: 100% 100%;
						}
					}
					.li3:hover{
						border-bottom: 1px solid #FE9333;
						color: #FE9333;
						.span3{
							background: url("../images/usercenter_leftnav_zjxx_hover.png") no-repeat;
							background-size: 100% 100%;
						}
					}
					.li4:hover{
						border-bottom: 1px solid #FE9333;
						color: #FE9333;
						.span4{
							background: url("../images/usercenter_leftnav_xxzx_hover.png") no-repeat;
							background-size: 100% 100%;
						}
					}


				}
			}
		}
		.exitBtn{
			float: right;
			color:@font-color;
			font-size: 16px;
			margin-left: 30px;
			line-height: 60px;
			cursor: pointer;
			margin-right:30px;			
		}
		.exitBtn:hover{
			color: #FE9333;
		}
		.loginbox-after:hover{
			.userCenterRight{
				right: 0;
				transition: all 0.5s;
			}
		}
	}
	.loginfooter{
		border:0 none;
	}
	.findPassword{
		.head{
			overflow:hidden;
			text-align: center;
			position: relative;
			div{
				width: 56px;
				height:61px;
				float:left;
				z-index: 3;
				position: relative;		
				color:@font-color;		
				font-size: 14px;
				p{
					width: 30px;
					height: 30px;
					line-height: 30px;
					border-radius: 50%;
					font-size: 16px;
					color: #fff;
					background-color: #B5BDC2;
					margin-left: 13px;
					margin-bottom: 15px;
				}
				.choosep{
					background-color: @font-blue-color;
				}
			}
			.headtwo{
				margin: 0 74px;
			}
			.headline{
				position: absolute;
				width: 254px;
				height: 6px;
				top:12px;
				left:43px;
				background-color: #F6FAF9;
				z-index: 2;
			}
		}
		.content{
			padding: 40px 10px 0 10px;
		}
		.one{
			height:298px;
		
		}
		
	}
	.findafter{
		.findafter-div{
			height: 400px;
			text-align: center;
			font-size: 14px;
			color: @font-color;
			img{
				width: 110px;
				height: 110px;
				margin-top: 90px;
			}
			.success{
				font-size: 30px;
				color: #4CB2EB;
				margin: 30px 0 10px;
			}
			.error{
				color: #F16473;
			}

		}
		
	}
</style>
<style lang="less">
	@primary-color:#FE9333;//橘黄色默认颜色
	@erro-color:#F16473;//默认报错红色
	@input-border-color:#E3E8EA;//输入框边框颜色
	@font-color:#686E71;//正常字体颜色
	@font-blue-color:#4CB2EB;//蓝色字体
	.login{
		//登录注册tap标签样式修改
		.ivu-modal-close{
			z-index: 3;
		}
		.ivu-modal-footer{
			display: none;
		}
		.ivu-modal-body{
			padding: 0;
		}
		.ivu-tabs-bar{
			border-bottom:none;
			margin-bottom: 30px;
		}
		.ivu-tabs-nav{
			margin-top: 29px;
		}
		.ivu-tabs-nav-scroll{
			padding-left:27%;
		}
		.ivu-tabs-nav .ivu-tabs-tab-active{
			color:@primary-color;
		}
		.ivu-tabs-ink-bar{
			min-width: 82px;
			background-color:@primary-color;		
		}
		.ivu-tabs-mini .ivu-tabs-tab{
			font-size:16px;
			padding: 10px 23px;
			box-sizing: border-box;
			border-bottom: 3px solid #CDD3D6;
		}
		//登录输入框样式
		.login-form{
			padding:0 40px;
		}
		.ivu-input{
			border: 1px solid @input-border-color;
		}
		.ivu-form-item-error .ivu-input{
			border: 1px solid @erro-color;
		}
		.login-password{
			margin-bottom: 40px;
		}
		.login-submit{
			margin-bottom: 10px;
			.ivu-btn{
				padding:5px 15px;
				font-size:16px;
			}
		}
		.ivu-form-item-error-tip{
			text-indent: 20px;
		}
		.ivu-checkbox-checked .ivu-checkbox-inner:after{//记住密码复选框
			border-color: @primary-color;
		}
		.ivu-checkbox-checked .ivu-checkbox-inner{
			background-color: #fff;
		}
		.savePassword{
			padding: 0 44px;
			color:@font-color;
			font-size:12px;
			margin-bottom: 43px;
			span:nth-child(3){
				float: right;
				cursor: pointer;
			}
		}
		.zctk{//注册条款
			padding: 0 44px;
			color:@font-color;
			font-size:12px;
			margin-bottom: 57px;
			span:nth-child(3){
				cursor: pointer;
				a{
					color:@font-blue-color;					
				}
				a:hover{
					color:@font-blue-color;
				}
			}
		}
		.otherLogin{//第三方登录
			padding: 0 44px;
			height: 26px;	
			line-height: 26px;	
			color:@font-color;
			margin-bottom: 50px;
			font-size:14px;
			span:first-child{
				display: inline-block;
				width: 24px;
				height: 1px;
				background-color: @input-border-color;
				vertical-align: text-top;
				margin-left: 65.5px;
			}
			span:nth-child(2),span:nth-child(3){
				display: inline-block;
				width: 26px;
				height: 26px;
				cursor: pointer;
				margin-left: 11px;
				img{
					width: 100%;
					height: 100%;
				}
			}
			span:last-child{
				display: inline-block;
				width: 24px;
				height: 1px;
				background-color: @input-border-color;
				margin-left: 13.5px;
				vertical-align: text-top;
			}
		}
		//注册样式
		.zc-form{
			.zc-password{
				margin-bottom: 40px;
			}
			.phoneYzm-input{
				width: 58.8%;
			}
			.phoneYzm-div{
				float: right;
				font-size: 14px;
				color: #4CB2EB;
				span{
					cursor: pointer;
					text-decoration: underline;
				}
				a{
					color: #4CB2EB;
				}
				a:hover{
					color: #4CB2EB;
				}
			}
			.ivu-btn{
				padding:0;
			}
			.phoneYzm-btn{
				float: right;
				// width: 38.2%;
				// padding:8px;
				background-color: #fff;
				color:@primary-color;
				border-color: @primary-color;
				span{
					width: 114px;
					height:36px;
					line-height:36px;
					display:inline-block;
				}
			}
			.phoneYzmNot{
				color:#B5BDC2;
				border-color: @input-border-color;
			}
		}
	}		
	.findPassword{
		.ivu-modal-body{
			padding:42px 32px 20px 32px;
			height:360px;
		}
		.ivu-modal-footer{
			display:none;
		}
		.findMm{
			.ivu-input{
				font-size: 14px;
			}
			.phoneYzm-btn{
				float: right;
				width: 120px;
				padding:8px;
				background-color: #fff;
				color:@primary-color;
				border-color: @primary-color;
			}
			.phoneYzmNot{
				color:#B5BDC2;
				border-color: @input-border-color;
			}
			.ivu-form-item-validating .ivu-input-icon-validate{
				display: none;
			}
		}

	}
	.findafter{
		.ivu-modal-body{
			padding:0;
		}
		.ivu-modal-footer{
			display:none;
		}
	}
	.ivu-modal-confirm-body-icon{
		display: none;
	}
	.ivu-modal-confirm-body{
		margin-top: 0;
		padding-top: 0;
		padding-left: 0;
		text-align: center;
	}
	.userBind{
		.ivu-modal-body{
			padding-bottom:1px;
		}
		.bind-title{
			height:107px;
			text-align:center;
			padding-top:40px;
			.p1{
				font-size:18px;
				font-weight:bold;
				margin-bottom:5px;
			}
		}
	}
	.findPsBtn{
		float: right;
		margin-top: 10px;
		width: 100px;
		height: 36px;
		font-size: 14px;
		margin-right:-32px;
	}
	.findPsLine{
		width:380px;
		height:1px;
		background-color:#F6FAF9;
		margin-left:-42px;
		margin-top:64px;
	}
	.iconInput{
		.ivu-input{
			padding-left:40px;
		}
	}
	.notMbewmModal{
		.ivu-modal-header{
			padding: 9px 16px;
			background: #F5F8F9;
			border-radius: 4px 4px 0 0;
		}
		.content{
			padding:30px;
			border-bottom:1px solid #E3E8EA;
			min-height: 202px;
			p{
				font-size: 14px;
				color: #686E71;
				line-height: 22px;
				margin-bottom:22px;
				span{
					color: #4CB2EB;
				}
			}
		}
	}
	.logo-div{
		.ivu-tooltip-rel{
			height: 32px;
		}
        .ivu-tooltip-inner{
            line-height: 28px;
            background-color: #fff;
            color:#686E71;
            font-size: 14px;
            height: 22px;
            padding: 1px 10px;
            min-height:28px;
            max-width:230px;
        }
        .ivu-tooltip-popper[x-placement^="bottom"] .ivu-tooltip-arrow{
            border-bottom-color: #fff;
        }
    }
</style>
<template>
	<header class="header">
		<Tooltip content="返回首页" placement="bottom-start" class="logo-div">
			<router-link to="index" class="logo"></router-link>				
		</Tooltip>
		<!-- <a href="javascript:;" class="logo"></a> -->
		<div class="navbox">
			<router-link to="home" v-if="loginstatus">人物传记</router-link>
			<a  @click="loginbtn" v-else>人物传记</a>
			<router-link to="homeShow" v-if="false">传记展示</router-link>
			<!-- <a href="javascript:;" title="敬请期待">亲友圈</a><a href="javascript:;" title="敬请期待">家谱树</a><a href="javascript:;" title="敬请期待">增值服务</a> -->
		</div>
		<div style="float:right;">
			<!--登录前-->		
			<div class="loginbox" v-show="!loginstatus">
				<a href="javascript:;" class="login" @click="loginbtn" >登录</a><a href="javascript:;" class="reg" @click="zcbtn" >注册</a>
			</div>
			<!--登录过后-->
			<div @click.stop="loginout()" class="exitBtn" v-show="loginstatus">退出</div>			
			<div class="loginbox-after" v-show="loginstatus"> 
				<div class="div">
					<img :src="(userheardImg ==''||userheardImg == 'null'||userheardImg == null) ?  staticimg+'/images/boy-2.png':imgurl + userheardImg " alt="用户头像" @click="goUserCenter">
				</div>
				<p @click="goUserCenter" class="p">{{username ? username : "用户名"}}</p>
				<!-- 个人中右侧浮层 -->
				<div class="userCenterRight" :style="'height:'+windowHeight">
					<!-- 头像 -->
					<img class="img" @click="userData" :src="(userheardImg ==''||userheardImg == 'null'||userheardImg == null) ?  staticimg+'/images/boy-2.png':imgurl + userheardImg " alt="用户头像"/>
					<!-- 用户名 -->
					<p class="name" @click="userData">{{username ? username : "用户名"}}</p>
					<ul class="ul">
						<li @click="userData" class="li1"><span class="span1"></span>个人资料</li>
						<li @click="safeSet" class="li2"><span class="span2"></span>安全设置</li>
						<li @click="zjData" class="li3"><span class="span3"></span>传记信息</li>
						<li @click="messageCenter" class="li4"><span class="span4"></span>消息中心</li>
					</ul>
				</div>
			</div>
		</div>
		<!-- 手机号 -->
		<div class="headerPhone"><img src="../images/topnav_tel@3x.png" alt=""></div>
		<Modal v-model="login" class="login" width="380">
			 <Tabs size="small" type="line" :value="tabType" :animated="false" @on-click="tabschoose">
				<Tab-pane label="登录" name="1">						
					<Form ref="formlogin" :model="formlogin" :rules="loginRule"  class="login-form"><!-- 登录表单 -->
						<Form-item prop="user" style="position: relative;">
							<img src="../images/home_login_user.png" style="position: absolute;top:6px;left:10px;z-index:10;"/>
							<Input type="text" v-model="formlogin.user" placeholder="请输入您的手机号" :maxlength="11" class="iconInput" @on-enter="loginSubmit('formlogin')"></Input>
						</Form-item>
						<Form-item prop="password" class="login-password" style="position: relative;">
							<img src="../images/home_login_password.png" style="position: absolute;top:6px;left:10px;z-index:10;"/>							
							<Input type="password" v-model="formlogin.password" placeholder="请输入您的登录密码" :maxlength="20" class="iconInput" @on-enter="loginSubmit('formlogin')"></Input>
						</Form-item>
						<Form-item class="login-submit">
							<Button type="warning" @click="loginSubmit('formlogin')" long >登录</Button>
						</Form-item>
					</Form>
					<!--记住密码-->
					<div class="savePassword">
						<Checkbox v-model="single"></Checkbox>
						<span>下次自动登录</span>
						<span @click="findPasswordFun()">忘记密码?</span>
					</div>
					<!--第三方登录-->
					<div class="otherLogin">
						<span></span>
						<span @click="QQlogin"><img src="../images/home_login_qq.png" alt=""></span>
						<span @click="wechatFn"><img src="../images/home_login_wechat.png" alt=""></span>
						<span></span>
					</div>
				</Tab-pane>
				<Tab-pane label="注册" name="2">
					<Form ref="formzc" :model="formzc" :rules="zcRule"  class="login-form zc-form"><!-- 登录表单 -->
						<Form-item prop="phone">
							<Input type="text" v-model="formzc.phone" placeholder="请输入您的手机号" :maxlength="11"></Input>
						</Form-item>
						<Form-item prop="phoneYzm" class="" >
							<Input type="text" v-model="formzc.phoneYzm" placeholder="请输入您的手机验证码" class="phoneYzm-input" :maxlength="6"></Input>
							<Button type="warning" :loading="loading"  :class="phoneYzmBtn" @click="getyzm()">
								<span v-show="!getyzmSpan" >获取验证码</span>
								<span v-show="getyzmSpan">{{yzmtime1}}s后重新发送</span>
							</Button>
						</Form-item>
						<Form-item prop="mbewm" class="" >
							<Input type="text" v-model="formzc.mbewm" placeholder="请输入墓碑二维码编码" class="phoneYzm-input" :maxlength="15"></Input>
							<div class="phoneYzm-div">无编码? <router-link to="getMbewm" target="_blank">立即获取</router-link></div>
						</Form-item>
						<Form-item prop="dlPassword" class="zc-password">
							<Input type="password" v-model="formzc.dlPassword" placeholder="请设置您的登录密码" :maxlength="20"></Input>
						</Form-item>
						<Form-item class="login-submit">
							<Button type="warning" @click="zcSubmit('formzc')" long style="padding:5px 15px;">免费注册</Button>
						</Form-item>
					</Form>
					<div class="zctk">
						<Checkbox v-model="single2"></Checkbox>
						<span>我已阅读并接受</span>						
						<span><router-link to="serviceAgreement" target="_blank">《久星网络用户注册条款》</router-link></span>
					</div>
				</Tab-pane>
			</Tabs>
			<div slot="footer" class="loginfooter"></div>
		</Modal>
		<Modal v-model="findPassword" class="findPassword" width="380">
			<!--第一步-->
			<div class="one" v-show="psone">
				<!--步骤-->
				<div class="head">
					<div>
						<p class="choosep">1</p>
						<span>基本信息</span>
					</div>
					<div class="headtwo">
						<p>2</p>
						<span>验证账户</span>
					</div>
					<div>
						<p>3</p>
						<span>重置密码</span>
					</div>
					<!--线-->
					<p class="headline"></p>
				</div>
				<!--内容-->
				<div class="content">
					<Form ref="psoneForm" :model="psoneForm" :rules="psoneRule" class="findMm">
						<Form-item prop="phone">
							<Input v-model="psoneForm.phone" placeholder="请输入您的账号"  class="longinput" long :maxlength="11"></Input>
						</Form-item>
						<Form-item prop="yzm">
							<Input v-model="psoneForm.yzm" placeholder="请输入验证码" style="width:170px;" :maxlength="6"></Input>
							<img  :src="'data:image/png;base64,'+yzmimgSrc" alt="" @click="yzmimg()" style="width:120px;height:36px;float:right" class="yzmimg">
						</Form-item>
					</Form>
					<div class="findPsLine"></div>			
					<Button type="warning" @click="pstonext('psoneForm')" class="findPsBtn">下一步</Button>			
				</div>
			</div>
			<!--第二步-->
			<div class="two" v-show="pstwo">
				<!--步骤-->
				<div class="head">
					<div>
						<p class="choosep">1</p>
						<span>基本信息</span>
					</div>
					<div class="headtwo">
						<p class="choosep">2</p>
						<span>验证账户</span>
					</div>
					<div>
						<p>3</p>
						<span>重置密码</span>
					</div>
					<!--线-->
					<p class="headline"></p>
				</div>
				<!--内容-->
				<div class="content">
					<Form ref="pstwoForm" :model="pstwoForm" :rules="pstwoRule" class="findMm">
						<Form-item prop="phone">
							<Input v-model="pstwoForm.phone"  disabled  class="longinput" long :maxlength="11"></Input>
						</Form-item>
						<Form-item prop="yzm">
							<Input v-model="pstwoForm.yzm" placeholder="请输入验证码" style="width:170px;" :maxlength="6"></Input>
							<Button type="warning" :loading="loading" @click="getyzmFind"  :class="phoneYzmFind">
								<span v-if="!getyzmSpanFind" >获取验证码</span>
								<span v-else>{{yzmtime3}}s后重新发送</span>
							</Button>
						</Form-item>
					</Form>				
					<div class="findPsLine"></div>				
					<Button type="warning" @click="psttwoxt('pstwoForm')"  class="findPsBtn">验证账户</Button>
				</div>
			</div>
			<!--第三步-->
			<div class="three" v-show="psthree">
				<!--步骤-->
				<div class="head">
					<div>
						<p class="choosep">1</p>
						<span>基本信息</span>
					</div>
					<div class="headtwo">
						<p class="choosep">2</p>
						<span>验证账户</span>
					</div>
					<div>
						<p class="choosep">3</p>
						<span>重置密码</span>
					</div>
					<!--线-->
					<p class="headline"></p>
				</div>
				<!--内容-->
				<div class="content">
					<Form ref="psthreeForm" :model="psthreeForm" :rules="psthreeRule" class="findMm">
						<Form-item prop="psword">
							<Input v-model="psthreeForm.psword"   class="longinput" long type="password"  placeholder="请输入您的新密码" :maxlength="20"></Input>
						</Form-item>
						<Form-item prop="pswordTwo">
							<Input v-model="psthreeForm.pswordTwo"   class="longinput" long type="password"  placeholder="请再次输入您的新密码" :maxlength="20"></Input>						
						</Form-item>
					</Form>					
					<div class="findPsLine"></div>			
					<Button type="warning" @click="psthreenxt('psthreeForm')" class="findPsBtn">确认密码</Button>	
				</div>
			</div>
		</Modal>
		<Modal v-model="findafter" class="findafter" width="600" >
			<!--修改成功-->
			<div v-show="findafterShow" class="findafter-div">
				<img src="../images/success.png" />
				<p class="success">修改成功！</p>
				<p>密码修改成功，请妥善保管</p>
			</div>
			<!--修改失败-->
			<div v-show="!findafterShow" class="findafter-div">
				<img src="../images/failed.png" />
				<p class="success error">修改失败！</p>
				<p>网络君又调皮了</p>
			</div>
		</Modal>
		<!--用户绑定-->
		<Modal class="login userBind" width="380" v-model="userBind" :mask-closable="false" :closable="false">
			<div class="bind-title">
				<p class="p1">绑定手机号</p>
				<p class="p2">绑定手机号后可使用微信扫一扫快捷登录</p>
			</div>
			<Form ref="formbind" :model="formbind" :rules="bindRule"  class="login-form zc-form"><!-- 登录表单 -->
				<Form-item prop="phone">
					<Input type="text" v-model="formbind.phone" placeholder="请输入您的手机号" :maxlength="11"></Input>
				</Form-item>
				<Form-item prop="phoneYzm" class="" >
					<Input type="text" v-model="formbind.phoneYzm" placeholder="请输入您的手机验证码" class="phoneYzm-input" :maxlength="6"></Input>
					<Button type="warning" :loading="loading"  :class="phoneYzmBind" @click="getyzmbind()">
						<span v-if="!getyzmSpanBind" >获取验证码</span>
						<span v-else>{{yzmtime2}}s后重新发送</span>
					</Button>
				</Form-item>
				<Form-item prop="mbewm" class="" v-show="bindingTombstoneQrCodeStatus">
					<Input type="text" v-model="formbind.mbewm" placeholder="请输入墓碑二维码编码" class="phoneYzm-input" :maxlength="15"></Input>
					<div class="phoneYzm-div">无编码? <router-link to="getMbewm" target="_blank">立即获取</router-link></div>
				</Form-item>
				<Form-item prop="dlPassword" class="zc-password" v-show="bindingMobileStatus">
					<Input type="password" v-model="formbind.dlPassword" placeholder="请设置您的登录密码" :maxlength="20"></Input>
				</Form-item>
				<Form-item class="login-submit">
					<Button type="warning" @click="bindSubmit('formbind')" long  style="padding:5px 15px;">提交</Button>
				</Form-item>
			</Form>
			<div class="zctk">
				<Checkbox v-model="single3"></Checkbox>
				<span>我已阅读并接受</span>
				<span><a href="">《久星网络用户注册条款》</a></span>
			</div>
		</Modal>
		<v-notice></v-notice>
		<!-- 墓碑二维码错误弹窗 -->
		<Modal v-model="notMbewm" title="消息" class="notMbewmModal"  width="380" @on-cancel="notMbewmCancel" >
			<div class="content">
				<p>为了更好地为您服务，请输入墓碑二维码编码</p>
				<Input type="text" v-model="notMbewmInput" placeholder="墓碑二维码编码" :maxlength="15"></Input>
			</div>
			<div slot="footer">
                <Button type="text" size="large" @click.stop="notMbewmCancel">取消</Button>                
                <Button type="warning" size="large" @click.stop="notMbewmSubmit">确定</Button>
            </div>
		</Modal>
		<Modal v-model="errorMbewm" title="消息" class="notMbewmModal"  width="380" @on-cancel="errorMbewmCancel">
			<div class="content">
				<p>尊敬的用户，您的操作异常，现已将您的二维码解绑，请输入您真实的墓碑二维码。<br /><span>申诉电话：400-0569-906</span></p>
				<Input type="text" v-model="errorMbewmInput" placeholder="墓碑二维码编码" :maxlength="15"></Input>
			</div>
			<div slot="footer">
                <Button type="text" size="large" @click.stop="errorMbewmCancel">取消</Button>                
                <Button type="warning" size="large" @click.stop="errorMbewmSubmit">确定</Button>
            </div>
		</Modal>
	</header>
</template>
<script>
	import global from '../config/global';
	import login from '../config/global';
	import { mapActions } from 'vuex';
    import { USER_SIGNIN } from 'store/user';
	import { USER_SIGNOUT } from 'store/user';
    export default {
		computed: {...mapActions({ user: state => state.user })},
		data() {
				const validatePhone = (rule, value, callback) => {//验证手机号规则
					if (value === '') {
						callback(new Error('请输入您的手机号'));
					} else if(value.length != "11"){
						callback(new Error('请输入11位手机号'));		
					}else if(!(/^1[3|4|5|7|8]\d{9}$/.test(value))){
						callback(new Error('请输入正确的手机号'));
					}else{
						callback();
					}
				};
				const validatePass = (rule, value, callback) => {//验证找回密码第三步两次密码输入情况
					if (value === '') {
						callback(new Error('请输入密码'));
					} else {
						if (this.psthreeForm.pswordTwo !== '') {
							// 对第二个密码框单独验证
							this.$refs.psthreeForm.validateField('pswordTwo');
						}
						callback();
					}
				};
				const validatePassCheck = (rule, value, callback) => {//验证找回密码第三步两次密码输入情况
					if (value === '') {
						callback(new Error('请再次输入密码'));
					} else if (value !== this.psthreeForm.psword) {
						callback(new Error('两次输入密码不一致!'));
					} else {
						callback();
					}
				};
				const validatePsword = (rule, value, callback) =>{
					if(!(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+$/.test(value))){
						callback(new Error('请输入6-20位数字与字母组合的密码'));
					}else{
						callback();
					}
				};
				const validatePsword2 = (rule, value, callback) =>{
					if(!(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+$/.test(value))&&this.bindingMobileStatus){
						callback(new Error('请输入6-20位数字与字母组合的密码'));
					}else{
						callback();
					}
				};
				const validateMbewm = (rule, value, callback) =>{
					if(value === ''&&this.bindingTombstoneQrCodeStatus){
						callback(new Error('请输入墓碑二维码编码'));
					}else{
						callback();
					}
				};
				return {
					staticimg:global.staticimg,
					imgurl:global.imgurl,
                    videourl:global.videourl,
                    musicurl:global.musicurl,
                    threeUrl:global.threeUrl,
					userBind:false,
					login:false,
					hotsimg:"",//图片前缀
					findPassword:false,//找回密码弹窗
					single:true,//记住密码复选框
					single2:true,//同意注册协议复选框
					single3:true,//同意注册协议复选框
					getyzmSpan:false,//获取验证码span
					getyzmSpanBind:false,
					phoneYzmBtn:"phoneYzm-btn",//获取验证码按钮样式
					phoneYzmFind:"phoneYzm-btn",//获取验证码按钮样式
					phoneYzmBind:"phoneYzm-btn",
					loginstatus:false,//登录状态
					tabType:"",//登录还是注册
					yzmtime1:"60",//验证码倒计时事件
					yzmtime2:"60",//验证码倒计时事件
					yzmtime3:"60",//验证码倒计时事件
					username:"",//用户名
					userheardImg:"",//用户头像路径
					yzmId:"",//验证码ID
					yzmIdFind:'',//找回密码验证码ID
					yzmIdbind:'',//用户绑定验证码ID
					yzmimgSrc:"",//图形验证码数据流
					yzmimgId:"",//图形验证码ID
					psone:true,//找回密码第一步
					pstwo:false,//找回密码第二步
					psthree:false,//找回密码第三步
					findafter:false,//找回密码第四步
					findafterShow:true,//
					formlogin: {//登录表单
						user: '',
						password: ''
					},
					formzc:{//注册表单
						phone:'',
						phoneYzm:'',
						dlPassword:'',
						mbewm:''
					},
					formbind:{//绑定
						phone:'',
						phoneYzm:'',
						dlPassword:'',
						mbewm:''
					},
					psoneForm:{
						phone:'',
						yzm:'',
					},
					pstwoForm:{
						phone:'',
						yzm:'',
					},
					psthreeForm:{
						psword:'',
						pswordTwo:'',
					},
					loginRule: {//登录表单验证
						user: [
							{ validator: validatePhone, trigger: 'blur' }							
						],
						password: [
							{ required: true, message: '请填写您的登录密码', trigger: 'blur' }
						]
					},
					zcRule:{//注册表单验证
						phone:[
							{ validator: validatePhone, trigger: 'blur' }
						],
						dlPassword:[
							{ validator: validatePsword, trigger: 'blur' },
							{ required: true, message: '请填写您的登录密码', trigger: 'blur' },
							{ required: true,min:6, message: '密码不能低于六位', trigger: 'blur' }
						],
						phoneYzm:[
							{ required: true, message: '请输入您的验证码', trigger: 'blur' },
						],
						mbewm:[//墓碑二维码编码验证
							{ required: true, message: '请输入墓碑二维码编码', trigger: 'blur' },
						]
					},
					psoneRule:{//找回密码第一步验证手机号
						phone:[
							{ validator: validatePhone, trigger: 'blur' }
						],
					},
					psthreeRule:{//找回密码第三步,密码是否相同验证
						psword:[
							{ validator: validatePass, trigger: 'blur' },	
							{ required: true,min:6, message: '密码不能低于六位', trigger: 'blur' }
						],
						pswordTwo:[
							
							{ validator: validatePassCheck, trigger: 'blur' },								
							{ required: true,min:6, message: '密码不能低于六位', trigger: 'blur' }
						],
					},
					pstwoRule:{
						yzm:[
							{ required: true, message: '请填写您的验证码', trigger: 'blur' }
						]
					},
					bindRule:{//注册表单验证
						phone:[
							{ validator: validatePhone, trigger: 'blur' }
						],
						dlPassword:[
							{ validator: validatePsword2, trigger: 'blur' },	
							{ min:6, message: '密码不能低于六位', trigger: 'blur' }
						],
						phoneYzm:[
							{ required: true, message: '请输入您的验证码', trigger: 'blur' },
						],
						mbewm:[//墓碑二维码编码验证
							{ validator: validateMbewm, trigger: 'blur' },
						]
					},
					Authorization:"",
					bindingMobileStatus:false,
					bindingTombstoneQrCodeStatus:false,
					windowHeight:"",//浏览器高度
					notMbewm:false,//无墓碑二维码编码
					errorMbewm:false,//墓碑二维码编码被解绑
					notMbewmInput:"",//无墓碑二维码编码-输入框
					errorMbewmInput:"",//墓碑二维码编码被解绑-输入框
					notMbewmType:1,//无墓碑二维码弹窗出处  1-登录 2-绑定
					errorMbewmType:1,//被解绑墓碑二维码弹窗出处  1-登录 2-绑定
				}
			},
		props:["loginBack"],
		watch:{
			'$route':"Wheight",
			'$route':"changeWindow",
		},
		created() {
			this.Wheight();			
			this.changeWindow();
			this.getUserInfo();
			if(this.loginstatus){
				if(localStorage.getItem('nickname') != null){
					this.username = localStorage.getItem('nickname');
				}
				if(localStorage.getItem('headerImg') != null){
					this.userheardImg = localStorage.getItem('headerImg');
				}
				if(JSON.parse(localStorage.getItem('user')).status == 3){
					this.login = false;							
					this.userBind = true;
					this.Authorization = JSON.parse(localStorage.getItem('user')).token_type+" "+JSON.parse(localStorage.getItem('user')).access_token;
					// alert(this.Authorization);
				}

			};
			if(localStorage.getItem('mbewmType') == 10){
				console.log('未绑定墓碑二维码');
				this.USER_SIGNOUT();
				this.$router.push({ path: '/index' });//跳转传记页面
				this.loginstatus = false;//登录状态
				//删除记录
				localStorage.removeItem('mbewmType');
			}
		},
		methods:{
			...mapActions([USER_SIGNIN]),
			getyzm(){	
				if(this.getyzmSpan){
					return;
				}
				var _this = this;
				this.$refs.formzc.validateField('phone',function(value){
					if(value==""){
					_this.$http.get(global.host+'/unsecured/captcha/get?mobile='+_this.formzc.phone)
	                    .then((response) => {   
	                        if(response.body.status == 1){
	                            _this.$Message.success('验证码已发送!');
	                            _this.yzmId = response.body.result;//验证码ID	                       
	                            _this.getyzmSpan = true;
	                            _this.phoneYzmBtn = "phoneYzm-btn phoneYzmNot";  
	 							_this.yzmtime1 = 60;  
	                            var timer1=setInterval(function(){
	                                _this.yzmtime1--
	                                if(_this.yzmtime1<=0){
	                                    _this.getyzmSpan = false;
	                                    _this.yzmtime1 = 60;
	                                    _this.phoneYzmBtn = "phoneYzm-btn";
	                                    clearInterval(timer1);
	                                }
	                            },1000);
	                        }else if(response.body.status == 0){
								_this.$Modal.confirm({
									width:"320",
									content:'<p>该账户已注册</p>',
									okText:"去登录",
									onOk: () => {
										_this.tabschoose('1');
									},
									onCancel: () => {
									}
								});		
	                        }
	                    })		                
					}
				})				
			},
			getyzmbind(){
				if(this.getyzmSpanBind){
					return;
				}
				var _this = this;
				this.$refs.formbind.validateField('phone',function(value){
					if(value==""){
					_this.$http.get(global.host+'/unsecured/captcha/bindingMobile/get?mobile='+_this.formbind.phone,{headers:{"Authorization":_this.Authorization}})
	                    .then((response) => {   
	                        if(response.body.status == 1){
	                            _this.$Message.success('验证码已发送!');
	                            _this.yzmIdbind = response.body.result;//验证码ID	                       
	                            _this.getyzmSpanBind = true;
	                            _this.phoneYzmBind = "phoneYzm-btn phoneYzmNot";  
								if(response.body.bindingMobileStatus == 0){
									//密码框显示
									_this.bindingMobileStatus = true;
								}else{
									_this.bindingMobileStatus = false;
								} 
								if(response.body.bindingTombstoneQrCodeStatus == 0){
									//密码框显示
									_this.bindingTombstoneQrCodeStatus = true;
								}else{
									_this.bindingTombstoneQrCodeStatus = false;
								}                
	                            var timer2=setInterval(function(){
	                                _this.yzmtime2--
	                                if(_this.yzmtime2<=0){
	                                    _this.getyzmSpanBind = false;
	                                    _this.yzmtime2 = 60;
	                                    _this.phoneYzmBind = "phoneYzm-btn";
	                                    clearInterval(timer2);
	                                }
	                            },1000);
	                        }else if(response.body.status == 0){
								
	                        }
	                    })		                
					}
				})			
			},
			getyzmFind(){//找回密码中的获取手机验证码
				if(this.getyzmSpanFind){
					return;
				}	
				this.$http.get(global.host+'/unsecured/captcha/findPassword/sms/get?mobile='+this.pstwoForm.phone)
				.then((response) => {
					if(response.body.status == 1){
							this.$Message.success('验证码已发送!');
							this.yzmIdFind = response.body.result;//验证码ID
							var _this = this;
							this.getyzmSpanFind = true;
							this.phoneYzmFind = "phoneYzm-btn  phoneYzmNot";
							_this.yzmtime = 60;		
							var timer3=setInterval(function(){
								_this.yzmtime3--
								if(_this.yzmtime3<=0){
									_this.getyzmSpanFind = false;
									_this.yzmtime3 = 60;
									_this.phoneYzmFind = "phoneYzm-btn";
									clearInterval(timer3);
								}
							},1000);
						}else{
							this.$Message.error('该手机尚未注册!');
						}
				})
			},
			//获取墓碑二维码编码
			getmbewm(){
				//跳转静态页面				 
				this.$router.push({ path: '/getMbewm' });//
			},
			loginbtn(){
				if(this.loginstatus){
					//this.$router.push({ path: '/home'});
					this.$router.push(this.loginBack());
					return;
				}
				this.login=true;
				this.tabType = "1";
				// this.$emit("loginbtnFN",true)
			},
			zcbtn(){
				this.login=true;
				this.tabType = "2";
				// this.$emit("loginbtnFN",true)
			},
			getYzmBtn(){
				
			},
			loginSubmit(name) {//登录表单
				var urlobject = this.loginBack();
				this.$refs[name].validate((valid) => {
					if (valid) {
						this.$http.post(global.host+'/login/check',{"loginName":this.formlogin.user,"password":this.formlogin.password})
						.then((response) => {						
							if(response.body.result.status == 1){
								this.USER_SIGNIN((response.body.result));//存入登录状态
								this.username = response.body.result.nickname;//用户名称								
								this.userheardImg = response.body.result.headAvatar;//用户头像 		
								localStorage.setItem("nickname", this.username);
								localStorage.setItem("headerImg",this.userheardImg);														
								//判断是否记住密码
								if(this.single){
									//把账号密码存入缓存中
									window.localStorage["history"]=JSON.stringify({'user':this.formlogin.user,"password":this.formlogin.password});								
								}else{
									//清除缓存
									window.localStorage.removeItem("history");
								}
								//关闭登录弹窗
								// this.$emit("loginbtnFN",false)
								this.login = false;
								this.loginstatus = true;//登录状态
								this.$router.push(urlobject);//跳转传记页面
								this.$Message.success('登录成功!');										
							}else if(response.body.result.status == 5){
								this.$Modal.confirm({
									width:"320",
									content:"<p>该账户不存在</p>",
									okText:"去注册",
									onOk: () => {
										this.tabschoose('2');
									},
									onCancel: () => {
									}
								});							
							}else if(response.body.result.status == 6){
								//未填写二维码编码
								this.notMbewmType = 1;
								this.notMbewm = true;
							}
							else if(response.body.result.status == 7){
								//二维码异常被解绑
								this.errorMbewmType = 1;
								this.errorMbewm = true;
							}else{
								this.$Message.error(response.body.message);
							}
						})
						.catch(function (response) {
							this.$Message.error('服务器出错,请稍后再试!');
						})				
					} else {
						// this.$Message.error('登录失败!');
					}
				})				                
			},
			//登录之后 墓碑二维码弹窗
			notMbewmSubmit(){//未绑定墓碑二维码弹窗--点击确定
				//判断当前弹窗是由登录或者第三方绑定弹出
				if(this.notMbewmInput == ""){
					this.$Message.error('请输入墓碑二维码编码');
					return;
				}
				if(this.notMbewmType == 1){
					//调用登录接口
					var urlobject = this.loginBack();
					this.$http.post(global.host+'/login/check',{"loginName":this.formlogin.user,"password":this.formlogin.password,"tombstoneQrCode":this.notMbewmInput})
						.then((response) => {
							if(response.body.result.status == 1){
								this.USER_SIGNIN((response.body.result));//存入登录状态
								this.username = response.body.result.nickname;//用户名称								
								this.userheardImg = response.body.result.headAvatar;//用户头像 		
								localStorage.setItem("nickname", this.username);
								localStorage.setItem("headerImg",this.userheardImg);														
								//判断是否记住密码
								if(this.single){
									//把账号密码存入缓存中
									window.localStorage["history"]=JSON.stringify({'user':this.formlogin.user,"password":this.formlogin.password});								
								}else{
									//清除缓存
									window.localStorage.removeItem("history");
								}
								//关闭登录弹窗
								// this.$emit("loginbtnFN",false)
								this.login = false;
								this.loginstatus = true;//登录状态
								this.notMbewm = false;
								this.$router.push(urlobject);//跳转传记页面
								this.$Message.success('登录成功!');	
							}else{
								this.$Message.error(response.body.message);
							}
						})
				}else if(this.notMbewmType == 2){
					//调用绑定接口
					this.$http.post(global.host+'/account/binding/tombstoneQrCodeNumber',{"tombstoneQrCode":this.notMbewmInput},{headers:{"Authorization":this.Authorization}})
						.then((response) => {
							if(response.body.status == 1){
								this.loginstatus = true;//登录状态
								this.$router.push({ path: '/home' });//跳转传记页面
								localStorage.removeItem('mbewmType');
							}else{
								this.$Message.error(response.body.message);
							}
					})
				}
			},
			notMbewmCancel(){//未绑定墓碑二维码弹窗--点击取消
				if(this.notMbewmType == 1){
					this.notMbewm = false;
					this.notMbewmInput = "";
				}else if(this.notMbewmType == 2){
					//清空登录状态
					this.USER_SIGNOUT();
					this.loginstatus = false;//登录状态
					this.notMbewm = false;
					this.notMbewmInput = "";
					localStorage.removeItem('mbewmType');
				}				
			},
			errorMbewmSubmit(){//被解绑墓碑二维码弹窗--点击确定
				//判断当前弹窗是由登录或者第三方绑定弹出
				if(this.errorMbewmInput == ""){
					this.$Message.error('请输入墓碑二维码编码');
					return;
				}
				if(this.errorMbewmType == 1){
					//调用登录接口
					var urlobject = this.loginBack();
					this.$http.post(global.host+'/login/check',{"loginName":this.formlogin.user,"password":this.formlogin.password,"tombstoneQrCode":this.errorMbewmInput})
						.then((response) => {
							if(response.body.result.status == 1){
								this.USER_SIGNIN((response.body.result));//存入登录状态
								this.username = response.body.result.nickname;//用户名称								
								this.userheardImg = response.body.result.headAvatar;//用户头像 		
								localStorage.setItem("nickname", this.username);
								localStorage.setItem("headerImg",this.userheardImg);														
								//判断是否记住密码
								if(this.single){
									//把账号密码存入缓存中
									window.localStorage["history"]=JSON.stringify({'user':this.formlogin.user,"password":this.formlogin.password});								
								}else{
									//清除缓存
									window.localStorage.removeItem("history");
								}
								//关闭登录弹窗
								// this.$emit("loginbtnFN",false)
								this.login = false;
								this.loginstatus = true;//登录状态
								this.errorMbewm = false;
								this.$router.push(urlobject);//跳转传记页面
								this.$Message.success('登录成功!');	
							}else{
								this.$Message.error(response.body.message);
							}
						})

				}else if(this.errorMbewmType == 2){
					//调用绑定接口
					this.$http.post(global.host+'/account/binding/tombstoneQrCodeNumber',{"tombstoneQrCode":this.errorMbewmInput},{headers:{"Authorization":this.Authorization}})
						.then((response) => {
							if(response.body.status == 1){
								this.loginstatus = true;//登录状态
								this.$router.push({ path: '/home' });//跳转传记页面
								localStorage.removeItem('mbewmType');
							}else{
								this.$Message.error(response.body.message);
							}
					})
				}
			},
			errorMbewmCancel(){//被解绑墓碑二维码弹窗--点击取消
				if(this.errorMbewmType == 1){
					this.errorMbewm = false;
					this.errorMbewmInput = "";
				}else if(this.errorMbewmType == 2){
					//清空登录状态
					this.USER_SIGNOUT();
					this.loginstatus = false;//登录状态
					this.errorMbewm = false;
					this.errorMbewmInput = "";
					localStorage.removeItem('mbewmType');
				}
			},
			QQlogin(){//QQ登录
				window.qqcallbackFn=this.qqcallbackFn
				//重定向地址，需要进行UrlEncode（登录成功回调的地址）
				// var redirectURI = encodeURIComponent("http://www.lifebook.xin/returnqqlogin");
				console.log(this.threeUrl);
				var redirectURI = encodeURIComponent(this.threeUrl+"/returnqqlogin");
					
				//打开QQ登录的界面
				QC.Login.showPopup({
					appId:"101368012",		 //应用唯一标识，在QQ互联平台提交应用审核通过后获得
					redirectURI:redirectURI, //重定向地址，需要进行UrlEncode（登录成功回调的地址）
					responseType:"code"		 //响应类型
				});
			},
			qqcallbackFn(response){
				var this_=this;
				//判断是否成功（0：登录失败，1：登录成功已绑定手机号码，3：登录成功未绑定手机号码，4：已删除,6:无墓碑二维码 7:被解绑墓碑二维码）
				
				if (response.result.status == 0) {
					var message = response.message;
					this_.$Message.error(message)

				}else if (response.result.status == 1) {
					this.USER_SIGNIN((response.result));//存入登录状态									
					this.username = response.result.nickname;//用户名称								
					this.userheardImg = response.result.headAvatar;//用户头像 
					localStorage.setItem("nickname", this.username);
					localStorage.setItem("headerImg",this.userheardImg);
					this.loginstatus = true;//登录状态
					this.$router.push({ path: '/home' });//跳转传记页面
				}else if (response.result.status == 3) {
					//未绑定过
					this.USER_SIGNIN((response.result));//存入登录状态
					this.username = response.result.nickname;//用户名称								
					this.userheardImg = response.result.headAvatar;//用户头像 
					localStorage.setItem("nickname", this.username);
					localStorage.setItem("headerImg",this.userheardImg);					
					this.login = false;							
					this.userBind = true;
					//保存登录状态
					this.Authorization = response.result.token_type+" "+ response.result.access_token
				}else if (response.result.status == 6) {
					this.USER_SIGNIN((response.result));//存入登录状态
					this.username = response.result.nickname;//用户名称								
					this.userheardImg = response.result.headAvatar;//用户头像 
					localStorage.setItem("nickname", this.username);
					localStorage.setItem("headerImg",this.userheardImg);					
					this.login = false;							
					localStorage.setItem("mbewmType", 10);
					//保存登录状态
					this.Authorization = response.result.token_type+" "+ response.result.access_token;
					//未填写二维码编码
					this.notMbewmType = 2;
					this.notMbewm = true;					
				}else if (response.result.status == 7) {
					this.USER_SIGNIN((response.result));//存入登录状态
					this.username = response.result.nickname;//用户名称								
					this.userheardImg = response.result.headAvatar;//用户头像 
					localStorage.setItem("nickname", this.username);
					localStorage.setItem("headerImg",this.userheardImg);		
					localStorage.setItem("mbewmType", 10);			
					this.login = false;							
					//保存登录状态
					this.Authorization = response.result.token_type+" "+ response.result.access_token;
					//二维码异常被解绑
					this.errorMbewmType = 2;
					this.errorMbewm = true;
				}else {
					var message = response.message;
					this_.$Message.warning(message)
				}
			},
			callbackFN(abc){//微信回调
				this.$http.post(global.host+'/third/weixin/login?code='+abc)	//确认登录之后上面那个alert没弹
					.then((response) => {
						
						if(response.body.result.status==1){
							this.USER_SIGNIN((response.body.result));//存入登录状态									
							this.username = response.body.result.nickname;//用户名称								
							this.userheardImg = response.body.result.headAvatar;//用户头像 
							localStorage.setItem("nickname", this.username);
							localStorage.setItem("headerImg",this.userheardImg);
							this.loginstatus = true;//登录状态
							this.$router.push({ path: '/home' });//跳转传记页面
						}else if(response.body.result.status==3){
							//未绑定过
							this.USER_SIGNIN((response.body.result));//存入登录状态
							this.username = response.body.result.nickname;//用户名称								
							this.userheardImg = response.body.result.headAvatar;//用户头像 
							localStorage.setItem("nickname", this.username);
							localStorage.setItem("headerImg",this.userheardImg);
							this.login = false;							
							this.userBind = true;
							//保存登录状态
							this.Authorization = response.body.result.token_type+" "+ response.body.result.access_token;
						}else if (response.body.result.status==6) {
							this.USER_SIGNIN((response.body.result));//存入登录状态
							this.username = response.body.result.nickname;//用户名称								
							this.userheardImg = response.body.result.headAvatar;//用户头像 
							localStorage.setItem("nickname", this.username);
							localStorage.setItem("headerImg",this.userheardImg);
							localStorage.setItem("mbewmType", 10);
							this.login = false;							
							//保存登录状态
							this.Authorization = response.body.result.token_type+" "+ response.body.result.access_token;
							//未填写二维码编码
							this.notMbewmType = 2;
							this.notMbewm = true;
						}else if (response.body.result.status==7) {
							this.USER_SIGNIN((response.body.result));//存入登录状态
							this.username = response.body.result.nickname;//用户名称								
							this.userheardImg = response.body.result.headAvatar;//用户头像 
							localStorage.setItem("nickname", this.username);
							localStorage.setItem("headerImg",this.userheardImg);
							localStorage.setItem("mbewmType", 10);
							this.login = false;							
							//保存登录状态
							this.Authorization = response.body.result.token_type+" "+ response.body.result.access_token;
							//二维码异常被解绑
							this.errorMbewmType = 2;
							this.errorMbewm = true;
						}
						
					})
			},
			wechatFn(){
				var this_=this;
				window.sx=this_.callbackFN;
				// window.open("https://open.weixin.qq.com/connect/qrconnect?appid=wx5364bc6a94eff485&redirect_uri=http://www.lifebook.xin/returnlogin&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect","childwindow",'width=600,height=600')
				window.open("https://open.weixin.qq.com/connect/qrconnect?appid=wx5364bc6a94eff485&redirect_uri="+this.threeUrl+"/returnlogin&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect","childwindow",'width=600,height=600')
			},
			zcSubmit(name){
				this.$refs[name].validate((valid) => {
					if (valid) {
						if(this.yzmId==""){
							this.$Message.error("请先获取验证码！");
							return;
						}
						this.$http.post(global.host+'/unsecured/register/save',{"mobile":this.formzc.phone,"capatchCode":this.formzc.phoneYzm,"capatchCodeId":this.yzmId,"tombstoneQrCode":this.formzc.mbewm,"userPwd":this.formzc.dlPassword})
						.then((response) => {	
							console.log(response.body.status);
							if(response.body.status == 1){
								this.$Message.success('注册成功!');
								this.$http.post(global.host+'/login/check',{"loginName":this.formzc.phone,"password":this.formzc.dlPassword})
								.then((response) => {
									this.USER_SIGNIN((response.body.result));//存入登录状态									
									this.username = response.body.result.nickname;//用户名称								
									this.userheardImg = response.body.result.headAvatar;//用户头像
									localStorage.setItem("nickname", this.username);
									localStorage.setItem("headerImg",this.userheardImg);	
									// this.$emit("loginbtnFN",false)
									this.loginstatus = true;//登录状态
									this.$router.push({ path: '/home' });//跳转传记页面
								})
							}else{
								this.$Message.error(response.body.message);
								
							}
						})
					} else {
						// this.$Message.error('登录失败!');
					}
				})
			},
			getUserInfo(){//检查浏览器是否存储账号密码
				this.hotsimg = global.host;
				if(window.localStorage["user"]){//判断是否登录过
					var userStaus = JSON.parse( window.localStorage["user"]);
					
					this.loginstatus = true;//登录状态
					this.username = userStaus.nickname;
					this.userheardImg = userStaus.headAvatar;					
				}else{
				}
				if(window.localStorage["history"]){
					var userinfo = JSON.parse( window.localStorage["history"]);
					this.formlogin.user=userinfo.user;
					this.formlogin.password=userinfo.password;
				}else{
				}
			},
			findPasswordFun(){//找回密码
				// this.$emit("loginbtnFN",false)
				this.findPassword = true;
				this.yzmimg();
			},
			yzmimg(){//获取图形 验证码
				this.$http.get(global.host+'/unsecured/graphics/validate/code/get')
                .then((response) => {	
                    if(response.body.status == 1){
                        this.yzmimgSrc = response.body.validateCode;
                        this.yzmimgId = response.body.graphicsValidateKey;
                    }else{
						this.$Message.error(response.body.message);
					}
                })
                .catch(function (response) {                   
                });
				
			},
			pstonext(name){//找回密码第一步
				this.$refs[name].validate((valid) => {
					if (valid) {
						if(this.psoneForm.yzm.length == 0){
							this.$Message.error('请输入验证码');
							return;
						}
						this.$http.get(global.host+'/unsecured/graphics/validate/code/check?validateCode='+this.psoneForm.yzm+'&graphicsValidateKey='+this.yzmimgId)
						.then((response) => {
							if(response.body.status==1){
								this.pstwoForm.phone = this.psoneForm.phone;//账号传到第二步去
								this.psone = false;
								this.pstwo = true;
							}else{
								this.$Message.error(response.body.message);
							}							
						})
					}
				})				
			},
			psttwoxt(name){
				this.$refs[name].validate((valid) => {
					if(valid){
						this.$http.get(global.host+'/unsecured/captcha/check/sms?mobile='+this.pstwoForm.phone+'&authCode='+this.pstwoForm.yzm+'&authCodeId='+this.yzmIdFind)
						.then((response) => {
							if(response.body.status == 1){
								this.$Message.success(response.body.message);
								this.psone = false;
								this.pstwo = false;
								this.psthree = true;
							}else{
								this.$Message.error(response.body.message);
							}
						})
					}
				})
				
			},
			psthreenxt(name){//确定修改密码
				this.$refs[name].validate((valid) => {
					if(valid){
						this.$http.post(global.host+'/findPassword/mobile/reset/password',{"mobile":this.pstwoForm.phone,"password":this.psthreeForm.psword,"confirmPassword":this.psthreeForm.pswordTwo})
						.then((response) => {
							if(response.body.status == 1){
								this.$Message.success(response.body.message);
								this.psthree = false;
								this.psone = true;
								this.findPassword = false;
								this.findafter = true;								
							}else{
								this.psthree = false;
								this.psone = true;
								this.findPassword = false;
								this.findafter = true;
								this.findafterShow = false;
							}
						})
					}
				})
			},
			goUserCenter(){//跳转个人中心页面
				this.$router.push({ path: '/usercenter' });//跳转传记页面
			},
			...mapActions([USER_SIGNOUT]),
			loginout(){
				this.$Modal.confirm({
					width: "320",
                    content: '<p>确定要退出登录么？</p>',
                    onOk: () => {
						//关闭消息提示
						this.$Notice.close('activity');
						this.$Notice.close('memoir');
						this.$Notice.close('system');
						this.USER_SIGNOUT();
						this.$router.push({ path: '/index' });//跳转传记页面
						this.loginstatus = false;//登录状态
                    },
                    onCancel: () => {
                    }
                });               
			},
			tabschoose(id){
				this.tabType = id;
			},
			bindSubmit(name){
				this.$refs[name].validate((valid) => {
					if (valid) {
						if(this.yzmIdbind==""){
							this.$Message.error("请先获取验证码！");
							return;
						}
						if(!this.single3){
							this.$Message.error("请先阅读用户协议!");
							return;
						}
						if(this.bindingMobileStatus && this.formbind.dlPassword == ""){
							this.$Message.error("请输入密码!");
							return;
						}
						this.$http.post(global.host+'/bindingMobile/update',{"mobile":this.formbind.phone,"validateCode":this.formbind.phoneYzm,"validateCodeId":this.yzmIdbind,"password":this.formbind.dlPassword,"tombstoneQrCode":this.formbind.mbewm},{headers:{"Authorization":this.Authorization}})
						.then((response) => {	
							if(response.body.status == 1){
								this.$Message.success(response.body.message);
								this.loginstatus = true;//登录状态
								var a = JSON.parse(localStorage.getItem('user'));
								a.status = 0;
								this.USER_SIGNIN(a);
								localStorage.setItem("nickname", response.body.realName);
								localStorage.setItem("headerImg", response.body.headAvatar);
								this.$router.push({ path: '/home' });//跳转传记页面

							}else{
								this.$Message.error(response.body.message);								
							}
							
						})
					} else {
					}
				})
			},
			Wheight(){//页面第一次加载执行使slide的高度和浏览器的可视区域高度一样
				var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
				this.windowHeight = (windowHeight-60)+'px';		
			},			
			changeWindow(){//浏览器宽高改变
				var _this = this;
				window.onresize=function(){
					_this.Wheight();
				}			
			},
			userData(){
                this.$router.push({ path: '/usercenter' });//跳转个人中心 用户资料               
            },
            safeSet(){
                this.$router.push({ path: '/usercenterSafe' });//跳转个人中心 安全设置                
            },
            messageCenter(){
                this.$router.push({ path: '/usercenterMessage',query:{"type":2} });//跳转个人中心 消息中心                
            },
            zjData(){
                this.$router.push({ path: '/usercenterZj' });//跳转个人中心 传记信息               
			},
			changeLang(){//改变语言
				if ( this.$i18n.locale === 'zh-CN' ) {
		          	//this.lang = 'en-US';
		          	this.$i18n.locale = 'en-US';//关键语句
		       }else {
		          	this.$i18n.locale = 'zh-CN';//关键语句
		       }
			}
		}
    }
</script>